package com.huarui.receiptAddress.dao.impl;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.impl.BaseDaoImpl;
import com.huarui.receiptAddress.dao.IReceiptAddressDao;
import com.huarui.receiptAddress.model.ReceiptAddress;

public class ReceiptAddressDaoImpl extends BaseDaoImpl implements
		IReceiptAddressDao {

	@Override
	@SuppressWarnings("unchecked")
	public List<ReceiptAddress> getReceiptAddressByCompanyId(Map map) {

		return (List<ReceiptAddress>) getSqlMapClientTemplate().queryForList(
				namespace + ".getReceiptAddressByCompanyId", map);
	}

	@Override
	public int countByConditions(Integer companyId) {

		return (Integer) getSqlMapClientTemplate().queryForObject(
				namespace + ".countByConditions", companyId);
	}
	
	@SuppressWarnings("unchecked")
	public List<ReceiptAddress> getReceiptAddressListByCompId(Integer compId) {
		return (List<ReceiptAddress>) getSqlMapClientTemplate().queryForList(super.namespace + ".getReceiptAddressByCompId", compId);
	}

	@Override
	public ReceiptAddress getReceiptAddressByAreaId(Map map) {
		
		return (ReceiptAddress)this.getSqlMapClientTemplate().queryForObject(super.namespace + ".getReceiptAddressByAreaId",map);
	}
}
